import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
          colorScheme: const ColorScheme(
              primary: Colors.black,
              surfaceVariant: Colors.white,
              secondary: Colors.green,
              background: Colors.white, //整个页面背景色
              error: Colors.red,
              brightness: Brightness.light,
              onBackground: Colors.white,
              outlineVariant: Colors.white,
              onError: Colors.yellow,
              onPrimary: Colors.white,
              onSecondary: Colors.white,
              onSurface: Color.fromARGB(255, 233, 233, 240),
              surface: Color.fromARGB(255, 17, 0, 255)) //整个标题栏颜色
          // primarySwatch: Colors.blue, // 设置主色调,无效，怎么设都是白色
          ),
      home: Scaffold(
        appBar: AppBar(title: const Text("图标"), centerTitle: true),
        body: const MyHomePage(),
      ),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return ListView(
      padding: const EdgeInsets.all(10),
      children: <Widget>[
        Image.network("https://www.itying.com/images/flutter/1.png"),
        Container(
          padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
          color: Colors.amber,
          height: 40,
          child: const Text(
            "图片标题1",
            textAlign: TextAlign.center,
            style: TextStyle(fontSize: 23, color: Colors.black),
          ),
        ),
        Image.network("https://www.itying.com/images/flutter/2.png"),
        const SizedBox(
          height: 44,
          child: Text(
            "图片标题2",
            textAlign: TextAlign.center,
            style: TextStyle(fontSize: 23, color: Colors.black),
          ),
        ),
        Image.network("https://www.itying.com/images/flutter/3.png"),
        const SizedBox(
          height: 44,
          child: Text(
            "图片标题3",
            textAlign: TextAlign.center,
            style: TextStyle(fontSize: 23, color: Colors.black),
          ),
        ),
        Image.network("https://www.itying.com/images/flutter/4.png"),
        const SizedBox(
          height: 44,
          child: Text(
            "图片标题4",
            textAlign: TextAlign.center,
            style: TextStyle(fontSize: 23, color: Colors.black),
          ),
        ),
        Image.network("https://www.itying.com/images/flutter/5.png"),
        const SizedBox(
          height: 44,
          child: Text(
            "图片标题5",
            textAlign: TextAlign.center,
            style: TextStyle(fontSize: 23, color: Colors.black),
          ),
        ),
        Image.network("https://www.itying.com/images/flutter/6.png"),
        const SizedBox(
          height: 44,
          child: Text(
            "图片标题6",
            textAlign: TextAlign.center,
            style: TextStyle(fontSize: 23, color: Colors.black),
          ),
        ),
      ],
    );
  }
}
